using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using T2.Logging.Data.Controllers.Interfaces;
using T2.Logging.Data.Entities.Interfaces;
using T2.Logging.Business.Entities.Interfaces;
using T2.Logging.Business.Entities;
using T2.Logging.Data.Controllers;
using T2.Logging.Business.Builders.Interface;
using T2.Logging.Business.Translators;
using T2.Logging.Business.Entities.Search.Interfaces;
using T2.Logging.Data.Entities.Search.Interfaces;


//--Change Management Control - LogCategory Builder  --**********************
//--Created By: trooks
//--Description: LogCategory Builder Class
//--Created Date: 03/07/2013 10:05:33
//--*************************************************************

namespace T2.Logging.Business.Builders
{
	public partial class LogCategory_Builder : ILogCategory_builder 
	{
		
	public List<ILogCategory_biz> BuildParts (ILogCategory_biz _param)
	{
			ILogCategory_biz temp = new LogCategory_biz();
			ILogCategoryController cont = new LogCategoryController();
			List<ILogCategory_biz> tempList = new List<ILogCategory_biz>();
			List<ILogCategory> tempData = new List<ILogCategory>();
			switch (_param.Action)
			{
				case "GetOne":
				temp = LogCategoryTranslator.TranslateFromDataLayer(cont.LogCategory_GetOne(LogCategoryTranslator.TranslateToDataLayer(_param)));
				tempList.Add(temp);
				return tempList;

				case "GetAll":
				tempData = cont.LogCategory_GetAll(LogCategoryTranslator.TranslateToDataLayer(_param));
				tempList = tempData.Select(p => LogCategoryTranslator.TranslateFromDataLayer(p)).Cast<ILogCategory_biz>().ToList();
				return tempList;

			}
			return tempList;
}
	public List<ILogCategory_biz> BuildParts (ILogCategorySearch_biz _param)
	{
			ILogCategory_biz temp = new LogCategory_biz();
			ILogCategoryController cont = new LogCategoryController();
			List<ILogCategory_biz> tempList = new List<ILogCategory_biz>();
			List<ILogCategory> tempData = new List<ILogCategory>();
			tempData = cont.LogCategory_Search(LogCategoryTranslator.TranslateSearchToDataLayer(_param));
			tempList = tempData.Select(p => LogCategoryTranslator.TranslateFromDataLayer(p)).Cast<ILogCategory_biz>().ToList();
			return tempList;

	}
		
	}
}
